#!/bin/sh

max=10
n=1
arr1[0]=1
arr2[0]=1
echo 1
for((n=1;n<=max;n++))
do
 echo -n 1" "
 for((i=1;i<=n;i++))
 do
   arr2[$i]=$((arr1[$i-1]+arr1[$i]))
   echo -n ${arr2[$i]}" "
 done
  for((i=1;i<=n;i++))
  do
    arr1[$i]=${arr2[$i]}
  done
 echo ""
done

